package br.com.carser.business;

import java.util.List;

import javax.ejb.Remote;

import br.com.carser.business.infra.BaseBusiness;
import br.com.carser.model.User;

/**
 * Interface to user business.
 * 
 * @author Eduardo
 */
@Remote
public interface UserBusiness extends BaseBusiness<User> {

	String BO_NAME = "userBO";
	
	/**
	 * Get by user name and password.
	 * 
	 * @param String: user name.
	 * @param String: password.
	 * 
	 * @return User: user.
	 * 
	 * @throws Throwable: connections issues.
	 */
	public abstract User getByUserNamePassword(String username, String password);

	/**
	 * Get by email.
	 * 
	 * @param String: email.
	 * 
	 * @return User: user.
	 * 
	 * @throws Throwable: connections issues.
	 */
	public abstract User getByEmail(String email);

	/**
	 * Get by name or user name.
	 * 
	 * @param String: name.
	 * @param String: user name.
	 * 
	 * @return List<User>: encountered users.
	 * 
	 * @throws Throwable: connections issues.
	 */
	public abstract List<User> getByNameUsername(String name, String username);
	
	public abstract List<User> getAll();

}